package com.wb.designmode.commod;

/**
 * 将一个请求封装成一个对象，从而让你使用不同的请求把客户端参数化，对请求排队或者记录请求日志，可以提供命令的撤销和恢复功能。
 */
public class StartMian {

    public static void main(String[] args) {
        Developer xiaoMing = new Developer("小明");
//        Requirement requirement = new Requirement("新增黑名单");
//        TechnicalManager1 technicalManager2 = new TechnicalManager1("大明");
//        technicalManager2.setDeveloper(xiaoMing);
//        technicalManager2.action(requirement, "develop");
//        System.out.println("开发了 2 天，需求变故，需要暂停。。。");
//        technicalManager2.action(requirement, "suspend");

        Command developCommand = new DevelopCommand(xiaoMing);
        Command suspendCommand = new SuspendCommand(xiaoMing);
        Requirement requirement = new Requirement("新增黑名单");
        TechnicalManager1 technicalManager = new TechnicalManager1("大明");
        technicalManager.setCommand(developCommand);
        technicalManager.action(requirement);
        System.out.println("开发了 2 天，需求变故，需要暂停。。。");
        technicalManager.setCommand(suspendCommand);
        technicalManager.action(requirement);
    }
}